log using figure_2, replace

***************** Replication of Franchino, Fabio, and Camilla Mariotto. “Bargaining Outcomes and Success in EU Economic Governance Reforms”. Political Science Research and Methods.

***************** Figure 2
version 16

use mad_NBSrp_noise.dta, clear

merge 1:1 v using mad_NBSnorp_noise.dta, nogen
merge 1:1 v using mad_comp_noise.dta, nogen
merge 1:1 v using mad_m_mean_noise.dta, nogen
merge 1:1 v using mad_minimax_noise.dta, nogen
merge 1:1 v using mad_PROCrp_noise.dta, nogen
merge 1:1 v using mad_PROCnorp_noise.dta, nogen

sum comp m_mean NBSnorp PROCnorp minimax PROCrp NBSrp

eclplot PROCrp PROCrp_u PROCrp_l v, estopts(msize(tiny)) rplottype(rspike) ciopts(msize(small)) graphregion(fcolor(white)) xlabel(, labsize(2)) ylabel(, nogrid labsize(2)) title("PROC", size(2.5)) saving(PROCrp_noise, replace) xlabel(1 "1" 20 "20" 40 "40", labsize(2)) ylabel(25 "25" 50 "50", labsize(2)) xtitle("St.dev. of Gaussian noise", size(2)) ytitle("Mean absolute error", size(2))  text(50 1.1 "Min 31.5" "Max 37.5", size(2) place(se) just(left) box fc(white) margin(l+1 t+1 b+1) width(10))

eclplot PROCnorp PROCnorp_u PROCnorp_l v, estopts(msize(tiny)) rplottype(rspike) ciopts(msize(small)) graphregion(fcolor(white)) xlabel(, labsize(2)) ylabel(, nogrid labsize(2)) title("PROC ¬ RP", size(2.5)) saving(PROCnorp_noise, replace) xlabel(1 "1" 20 "20" 40 "40", labsize(2)) ylabel(25 "25" 50 "50", labsize(2)) xtitle("St.dev. of Gaussian noise", size(2)) ytitle("Mean absolute error", size(2)) text(50 1.1 "Min 20" "Max 33.9", size(2) place(se) just(left) box fc(white) margin(l+1 t+1 b+1) width(10))

eclplot NBSrp NBSrp_u NBSrp_l v, estopts(msize(tiny)) rplottype(rspike) ciopts(msize(small)) graphregion(fcolor(white)) xlabel(, labsize(2)) ylabel(, nogrid labsize(2)) title("NBS", size(2.5)) saving(NBSrp_noise, replace) xlabel(1 "1" 20 "20" 40 "40", labsize(2)) ylabel(25 "25" 50 "50", labsize(2)) xtitle("St.dev. of Gaussian noise", size(2)) ytitle("Mean absolute error", size(2)) text(55 6 "Min 39.8" "Max 45.7", size(2) place(se) just(left) box fc(white) margin(l+1 t+1 b+1) width(10))

eclplot NBSnorp NBSnorp_u NBSnorp_l v, estopts(msize(tiny)) rplottype(rspike) ciopts(msize(small)) graphregion(fcolor(white)) xlabel(, labsize(2)) ylabel(, nogrid labsize(2)) title("NBS ¬ RP", size(2.5)) saving(NBSnorp_noise, replace) xlabel(1 "1" 20 "20" 40 "40", labsize(2)) ylabel(25 "25" 50 "50", labsize(2)) xtitle("St.dev. of Gaussian noise", size(2)) ytitle("Mean absolute error", size(2)) text(50 1.1 "Min 20.8" "Max 24.8", size(2) place(se) just(left) box fc(white) margin(l+1 t+1 b+1) width(10))

eclplot comp comp_u comp_l v, estopts(msize(tiny)) rplottype(rspike) ciopts(msize(small)) graphregion(fcolor(white)) xlabel(, labsize(2)) ylabel(, nogrid labsize(2)) title("Compromise", size(2.5)) saving(comp_noise, replace) xlabel(1 "1" 20 "20" 40 "40", labsize(2)) ylabel(25 "25" 50 "50", labsize(2)) xtitle("St.dev. of Gaussian noise", size(2)) ytitle("Mean absolute error", size(2)) text(50 1.1 "Min 18.5" "Max 24", size(2) place(se) just(left) box fc(white) margin(l+1 t+1 b+1) width(10))

eclplot m_mean m_mean_u m_mean_l v, estopts(msize(tiny)) rplottype(rspike) ciopts(msize(small)) graphregion(fcolor(white)) xlabel(, labsize(2)) ylabel(, nogrid labsize(2)) title("Mean", size(2.5)) saving(mean_noise, replace) xlabel(1 "1" 20 "20" 40 "40", labsize(2)) ylabel(25 "25" 50 "50", labsize(2)) xtitle("St.dev. of Gaussian noise", size(2)) ytitle("Mean absolute error", size(2)) text(50 1.1 "Min 20.3" "Max 24.6", size(2) place(se) just(left) box fc(white) margin(l+1 t+1 b+1) width(10))
 
eclplot minimax minimax_u minimax_l v, estopts(msize(tiny)) rplottype(rspike) ciopts(msize(small)) graphregion(fcolor(white)) xlabel(, labsize(2)) ylabel(, nogrid labsize(2)) title("Minimax", size(2.5)) saving(minimax_noise, replace) xlabel(1 "1" 20 "20" 40 "40", labsize(2)) ylabel(25 "25" 50 "50", labsize(2)) xtitle("St.dev. of Gaussian noise", size(2)) ytitle("Mean absolute error", size(2)) text(50 1.1 "Min 30.3" "Max 30.8", size(2) place(se) just(left) box fc(white) margin(l+1 t+1 b+1) width(10))

gr combine PROCrp_noise.gph PROCnorp_noise.gph NBSrp_noise.gph NBSnorp_noise.gph comp_noise.gph mean_noise.gph minimax_noise.gph, cols(2) graphregion(fcolor(white)) saving(figure_2_noise, replace) 

* computation for minimun, maximum and range values for each model
* COMP
sum comp
matrix MN = r(min)
matrix MX = r(max)
matrix D = MX - MN
matrix list D

* PROC ¬ RP
sum PROCnorp
matrix MN = r(min)
matrix MX = r(max)
matrix D = MX - MN
matrix list D

* mean
sum m_mean
matrix MN = r(min)
matrix MX = r(max)
matrix D = MX - MN
matrix list D

* NBS ¬ RP
sum NBSnorp
matrix MN = r(min)
matrix MX = r(max)
matrix D = MX - MN
matrix list D

* Minimax
sum minimax
matrix MN = r(min)
matrix MX = r(max)
matrix D = MX - MN
matrix list D

* PROC
sum PROCrp
matrix MN = r(min)
matrix MX = r(max)
matrix D = MX - MN
matrix list D

* NBS
sum NBSrp
matrix MN = r(min)
matrix MX = r(max)
matrix D = MX - MN
matrix list D

log close

